var express = require('express');
var bodyParser = require('body-parser');
var app = express();
var cors = require('cors')

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cors());

// 微信小程序获取用户信息
var getUserInfo = require('./aes/index.js')

app.get('/', function (req, res) {
  let data = getUserInfo()
  res.send(data)
})


var server = app.listen(3000, function (req, res) {
  var host = server.address().address;
  var port = server.address().port;
  console.log('Example app listening at http://%s:%s', host, port);
});